package com.example.test.repo;

import com.example.test.entity.Weather;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Map;

/**
 * 日期：2022/11/5
 * 作者：flag
 * 功能：
 */
public interface WeatherRepository extends JpaRepository<Weather, Integer> {
    @Query(value = "select location,stname,MAX(temp) maxtemp,MIN(temp) mintemp,date_ date from weather GROUP BY location,stname,date_ order by date_,location", nativeQuery = true)
    List<Map> getWeatherMinMaxTmp();
}
